<%@ page import="ar.org.sstuyv.Barrio"%>

<!DOCTYPE html>
<html>
<head>
<meta name="layout" content="main">
<g:set var="entityName"
	value="${message(code: 'barrio.label', default: 'Barrio')}" />
<title><g:message code="default.create.label"
		args="[entityName]" /></title>
<r:require module="Barrio" />

</head>
<body>
	<script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
	<a href="#create-barrio" class="skip" tabindex="-1"><g:message
			code="default.link.skip.label" default="Skip to content&hellip;" /></a>
	<div class="nav" role="navigation">
		<ul>
			<li><a class="home" href="${createLink(uri: '/')}"><g:message
						code="default.home.label" /></a></li>
			<li><g:link class="list" action="list">
					<g:message code="default.list.label" args="[entityName]" />
				</g:link></li>
		</ul>
	</div>
	<div id="create-barrio" class="content scaffold-create" role="main">
		<h1>
			<g:message code="default.create.label" args="[entityName]" />
		</h1>
		<g:if test="${flash.message}">
			<div class="message" role="status">
				${flash.message}
			</div>
		</g:if>
		<g:hasErrors bean="${barrioInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${barrioInstance}" var="error">
					<li
						<g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
							error="${error}" /></li>
				</g:eachError>
			</ul>
		</g:hasErrors>

		<g:form action="save">
			<fieldset class="form">
				<div class="fieldcontain">
					<label>Partido</label> <select id="partido" name="partido.id"
						required="" onchange="establecerPartido(this.value);"
						class="many-to-one">
						<option value=""></option>
						<option value="001">Adolfo Alsina</option>
						<option value="002">Alberti</option>
						<option value="003">Almirante Brown</option>
						<option value="128">Ameghino</option>
						<option value="010">Arrecifes</option>
						<option value="004">Avellaneda</option>
						<option value="005">Ayacucho</option>
						<option value="006">Azul</option>
						<option value="007">Bahia Blanca</option>
						<option value="008">Balcarce</option>
						<option value="009">Baradero</option>
						<option value="120">Berazategui</option>
						<option value="114">Berisso</option>
						<option value="011">Bolivar</option>
						<option value="012">Bragado</option>
						<option value="013">Brandsen</option>
						<option value="014">Campana</option>
						<option value="015">Cañuelas</option>
						<option value="121">Capitan Sarmiento</option>
						<option value="016">Carlos Casares</option>
						<option value="017">Carlos Tejedor</option>
						<option value="018">Carmen de Areco</option>
						<option value="020">Castelli</option>
						<option value="026">Chacabuco</option>
						<option value="027">Chascomus</option>
						<option value="028">Chivilcoy</option>
						<option value="021">Colon</option>
						<option value="022">Coronel Dorrego</option>
						<option value="023">Coronel Pringles</option>
						<option value="113">Coronel Rosales</option>
						<option value="024">Coronel Suarez</option>
						<option value="019">Daireaux</option>
						<option value="029">Dolores</option>
						<option value="115">Ensenada</option>
						<option value="118">Escobar</option>
						<option value="030">Esteban Echeverria</option>
						<option value="031">Exaltacion de la Cruz</option>
						<option value="130">Ezeiza</option>
						<option value="032">Florencio Varela</option>
						<option value="033">General Alvarado</option>
						<option value="034">General Alvear</option>
						<option value="035">General Arenales</option>
						<option value="036">General Belgrano</option>
						<option value="037">General Guido</option>
						<option value="040">General Lamadrid</option>
						<option value="041">General Las Heras</option>
						<option value="042">General Lavalle</option>
						<option value="039">General Madariaga</option>
						<option value="043">General Paz</option>
						<option value="044">General Pinto</option>
						<option value="045">General Pueyrredón</option>
						<option value="046">General Rodriguez</option>
						<option value="047">General San Martin</option>
						<option value="049">General Viamonte</option>
						<option value="050">General Villegas</option>
						<option value="051">Gonzales Chaves</option>
						<option value="052">Guamini</option>
						<option value="119">Hipolito Yrigoyen</option>
						<option value="135">Hurlingham</option>
						<option value="309">Islas Baradero</option>
						<option value="314">Islas Campana</option>
						<option value="387">Islas Ramallo</option>
						<option value="396">Islas San Fernando</option>
						<option value="398">Islas San Nicolas</option>
						<option value="399">Islas San Pedro</option>
						<option value="357">Islas Tigre</option>
						<option value="338">Islas Zarate</option>
						<option value="136">Ituzaingo</option>
						<option value="132">Jose C. Paz</option>
						<option value="053">Juarez</option>
						<option value="054">Junin</option>
						<option value="123">La Costa</option>
						<option value="025">Lanus</option>
						<option value="055">La Plata</option>
						<option value="056">Laprida</option>
						<option value="058">Las Flores</option>
						<option value="059">Leandro N. Alem</option>
						<option value="137">Lezama</option>
						<option value="060">Lincoln</option>
						<option value="061">Loberia</option>
						<option value="062">Lobos</option>
						<option value="063">Lomas de Zamora</option>
						<option value="064">Lujan</option>
						<option value="065">Magdalena</option>
						<option value="066">Maipu</option>
						<option value="133">Malvinas Argentinas</option>
						<option value="069">Mar Chiquita</option>
						<option value="068">Marcos Paz</option>
						<option value="070">Matanza</option>
						<option value="071">Mercedes</option>
						<option value="072">Merlo</option>
						<option value="073">Monte</option>
						<option value="126">Monte Hermoso</option>
						<option value="074">Moreno</option>
						<option value="101">Moron</option>
						<option value="075">Navarro</option>
						<option value="076">Necochea</option>
						<option value="077">Nueve de Julio</option>
						<option value="078">Olavarria</option>
						<option value="079">Patagones</option>
						<option value="080">Pehuajo</option>
						<option value="081">Pellegrini</option>
						<option value="082">Pergamino</option>
						<option value="083">Pila</option>
						<option value="084">Pilar</option>
						<option value="124">Pinamar</option>
						<option value="129">Pte. Peron</option>
						<option value="085">Puan</option>
						<option value="134">Punta Indio</option>
						<option value="086">Quilmes</option>
						<option value="087">Ramallo</option>
						<option value="088">Rauch</option>
						<option value="089">Rivadavia</option>
						<option value="090">Rojas</option>
						<option value="091">Roque Perez</option>
						<option value="092">Saavedra</option>
						<option value="093">Saladillo</option>
						<option value="122">Salliquelo</option>
						<option value="067">Salto</option>
						<option value="094">San Andres de Giles</option>
						<option value="095">San Antonio de Areco</option>
						<option value="116">San Cayetano</option>
						<option value="096">San Fernando</option>
						<option value="097">San Isidro</option>
						<option value="131">San Miguel</option>
						<option value="098">San Nicolas</option>
						<option value="099">San Pedro</option>
						<option value="100">San Vicente</option>
						<option value="102">Suipacha</option>
						<option value="103">Tandil</option>
						<option value="104">Tapalque</option>
						<option value="057">Tigre</option>
						<option value="105">Tordillo</option>
						<option value="106">Tornquist</option>
						<option value="107">Trenque Lauquen</option>
						<option value="108">Tres Arroyos</option>
						<option value="117">Tres de Febrero</option>
						<option value="127">Tres Lomas</option>
						<option value="109">Veinticinco de Mayo</option>
						<option value="110">Vicente Lopez</option>
						<option value="125">Villa Gesell</option>
						<option value="111">Villarino</option>
						<option value="038">Zarate</option>



					</select>
				</div>
				<g:render template="form" />
			</fieldset>
	</div>
	<div class="content">
		<div id="tbar-id"></div>
		<div id="map-id"></div>
	</div>
	<fieldset class="buttons">
		<g:submitButton name="create" class="save"
			value="${message(code: 'default.button.create.label', default: 'Create')}" />
	</fieldset>
	</g:form>
	<script>
		//OpenLayers.ImgPath = "/SIG/static/js/resources/openlayers/img/";
		OpenLayers.ProxyHost = '/cgi-bin/proxy.cgi?url=';

		// the `panel` variable is declared here for easy debugging
		var panel;
		var map;

		var toolbar;
		var dibujar;
		var navegar;
		var guardar;
		var cancelar;
		var resetear;
		var select;

		var barrios;
		var partido;
		var saveStrategy;
		var cod_partido;
		var dir_ref;
		var nomencla_origen;
		var url_wfs = "http://localhost:8080/geoserver/wfs";

		var nombre_capa_editable_barrios = "barrios";
		var nombre_capa_de_partidos = "partidos_arba_depto_INDEC"; // se usa la columna id_indec(numeric) linea 233 panel.js

		function establecerPartido(parametros) {
			cod_partido = parametros;
			console.log("Parametros: " + parametros);
			map.setPartido(parametros);
		}

		function establecerNomencla(param) {
			nomencla_origen = param;
		}
	</script>
</body>
</html>
